package com._dev.social.mapper;

import com._dev.social.mode.domain.Threads;
import com._dev.social.mode.domain.response.ThreadResp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【threads】的数据库操作Mapper
 * @createDate 2024-11-06 17:54:06
 * @Entity com._dev.social.mode.domain.Threads
 */
@Mapper
public interface ThreadsMapper extends BaseMapper<Threads> {
    // 获取所有线程
    @Select("SELECT * FROM threads")
    List<Threads> getAllThreads();

    @Select("""
                SELECT * FROM threads WHERE userId = #{userId}
            """)
    List<ThreadResp> getListFollowThreadById(String userId);
}




